1. Field of the Invention
The present invention relates to an image processing apparatus, an image processing method, a program and a computer-readable print medium, which appropriately correct an image data, and in particular, to an image processing apparatus, an image processing method, and a print medium, which detect a major subject to correct an image data and once more detect the major subject from the corrected image to make a different image correction.
2. Description of the Related Art
In recent years, it has increased that an input device of an image or an image processing apparatus makes a correction of an image through analysis of the image at inputting or printing the image. Here, the input device is a digital camera for photographing an image, for example. The image processing apparatus is, for example, a printer which receives an image from an input device to print out the image.
Among analysis functions of the image used in the input device or the image processing apparatus, a face detecting function of a person as a major subject in the image has been in the spotlight.
By detecting the face in the image, AF or exposure is controlled to suit to the detected face in the input device and correction control for printing is performed based upon information of the detected face in the image processing apparatus.
Under such a situation, the environment that each of the input device and the image processing apparatus has the face detecting function has begun to be constructed.
Although the function is expressed as the face detecting function by a single phrase, the function has various specifications and features.
For example, in the input device, face detection is performed at the time of inputting an image. Therefore, the face detection in accordance with a video is performed by a face detecting function, and face detecting algorithms and parameters requiring follow-up characteristics or real time characteristics of a face area are adopted therein. Particularly, by detecting the face together with an exposure correction at the time of inputting the image by the input device, the face detecting function in the input device increases the exposure degree in a dark scene or in a backlighting scene, making it possible to more easily detect the face. In reverse, in a bright scene, the face detecting function of the input device decreases the exposure degree to detect the face. In this way, the face can be detected by changing the input image dynamically.
According to the face detecting function in the input device, a face is detected to limit a detection orientation of the face to a camera photographing orientation by a combination of an acceleration sensor or an angle sensor, thereby making it possible to shorten the detection time.
According to the face detecting function in the input device, a user performs focus, image angle and pint adjustments while looking at the face detection result displayed on a finder or liquid crystal. Therefore, sufficient image detection performance can be maintained with the image detecting technology having not so much high accuracy.
According to the face detecting function in the input device, a user can determine an erroneous detection on the spot. Therefore, it has an advantage of being capable of reducing the final erroneous detections in number.
Further, according to the face detecting function in the input device, range information, a focus point and the like of a subject can be observed immediately. Therefore, these pieces of the information are feed-backed to the face detection, thereby making it possible also to enhance the face detection performance as a whole.
On the other hand, according to the face detecting function in the image processing apparatus, which is different from the face detecting function in the input device, the face detection is generally performed from one sheet of a still image data and therefore, real time characteristics are not required. Since in the face detecting function in the image processing apparatus, all pieces of the information at taking the focus in the input device can not be used, the image processing apparatus has a tendency of taking more time for performing the face detection.
Therefore, information of a tag in an Exif (Exchangeable Image File Format) file in which various pieces of control information in the input device at the time of inputting the image are described is used to control parameters of the face detecting function in the image processing apparatus.
The most remarkable feature of the face detecting function in the image processing apparatus lies in a point that, since the real time characteristics are not required, the face detection can be performed in the middle of finely changing a orientation of the face detection or a size of the face.
In the face detecting function in the input device, it is sufficient only to detect a rough position of the face, but in the face detection function in the image processing apparatus, it is easy to detect a position, a size, a orientation and the like of the face in more detail. Further, if the face information is processed by a PC (Personal Computer) or the like, the face detection can be more accurately performed by the face detecting function in the input device than by the face detecting function in the image processing apparatus.
Japanese Patent Laid-Open No. 2004-207987 discloses the invention in which an image processing apparatus receives a photography image data storing face coordinates detected at the time of photographing an image by an input device as a part of information of an Exif file and the printing is carried out by making the image correction by using the face coordinates.
In addition, according to the input device, in a case of placing importance on real time characteristics, the face detection function may be performed while giving feedback of the face detection at a video, and sensor information other than the face detection.
However, the face detecting function in the image processing apparatus is generally more excellent in view of face detection accuracy than in the input device. Particularly the detection accuracy of the information such as a size or an inclination of the face is high.
Further, since a time lag occurs from a point of performing face detection until a point of actually taking a photo in the input device, a face area at detecting may differ from that of a face detection result on the photographed image data due to movement of a person as a subject, movement of a cameraman and the like.
FIG. 16 shows an example where a face area in a case of face detection at photographing by the input device is shifted from a face area in a case of face detection by an image data which the image processing apparatus receives from the input device. An image 1601 shows a face position at photographing by the input device, that is, at the time of performing face detection by the input device in a state where a user pushes a shutter to a half position. A face area 1602 at this point is expressed by coordinates of four points of left top (LT), left bottom (LB), right top (RT) and right bottom (RB).
An image 1603 shows an example where, when a user fully pushes a shutter in the input device for taking a photo, the photographed image data is inclined by rotation of the input device or the like. A face area 1604 at this point is expressed by coordinates of four points of left top (LT′), left bottom (LB′), right top (RT′) and right bottom (RB′).
An image 1605 shows an example where, when a user fully pushes a shutter in the input device for taking a photo, a subject moves right in the facing orientation. At this point, a face area 1606 is expressed by coordinates of four points of left top (LT″), left bottom (LB′ right top (RT″) and right bottom (RB″).
As described above, there occurs a case where the coordinates of the face area 1602 detected by the input device are different from the coordinates of the face areas 1604 and 1606 detected by the image processing apparatus after the photographing by the input device.
In a case where the face area detected by the input device is different from the face area on the image data detected by the image processing apparatus to produce the position shift from each other, it raises the problem that the subsequent processing is executed based upon information of the erroneous face area in the image processing apparatus.
Particularly in a case of making a local correction using the detection result of the face area, the correction result of the image including the face area may not be appropriate due to this detection error (position shift).
The present invention is made in view of the foregoing problem and an object of the present invention is to provide an image processing apparatus which, when a position shift occurs in a detection position of a major subject in an image such as a face area, can appropriately make a correction of the position shift.